<template>
    <div style="width: 1200px;margin:0 auto;">
        <!-- 面包屑设置 -->
        <bread-crumb :title="schoolDate.schoolName"></bread-crumb>
        <!-- 整体页面设置 -->
        <div class="introduction-head f-c-sb">
            <!-- 左边样式 ：图片部分-->
            <div class="introduction-head-left">
                <div class="el-image">
                    <img :src="'/api' + schoolDate.firstImage" alt="" style="object-fit: cover;width: 100%;height: 100%;">
                </div>
            </div>
            <!-- 右边样式：文字部分 -->
            <div class="introduction-head-right">
                <div class="right-title">{{ schoolDate.schoolName }}</div>
                <div class="right-label f-c-st">
                    <div class="item-label f-c-c" v-for="(item, index) in schoolDate.label" :key="index">
                        {{ item }}
                    </div>
                </div>
                <div class="right-text">"明德至诚,博学远志"</div>
                <div class="school-info f-c-sb">
                    <div class="f-c-st">
                        <div class="school-info-label">学校性质</div>
                        <div class="school-info-text">{{ schoolDate.schoolNature }}</div>
                    </div>
                    <div class="f-c-st" style="width:243px;">
                        <div class="school-info-label">学校官网</div>
                        <div class="school-info-text"> {{ schoolDate.officialAddress }}</div>
                    </div>
                </div>
                <!-- 联系学校 -->
                <div class="school-info f-c-sb">
                    <div class="f-c-st">
                        <div class="school-info-label">学校电话</div>
                        <div class="school-info-text">{{ schoolDate.schoolPhone }}</div>
                    </div>
                    <div class="f-c-st" style="width:243px;">
                        <div class="school-info-label">院校地址</div>
                        <div class="school-info-text" style="width:167px;">{{ schoolDate.schoolAddress }}</div>
                    </div>
                </div>
                <div class="school-introduce">
                    {{ schoolDate.synopsis }}
                </div>
            </div>

        </div>
        <!-- 校园风光 -->
        <div>
            <div style="padding:23px 0px;margin:33px 0px 0px;">
                <div class="lable-item f-c-st">
                    <div class="lable-item-text">校园风光</div>
                    <div class="f-c-c">
                        <img src="../assets/ggdfx.png" alt="">
                    </div>
                </div>
            </div>
            <div class="swiper-container swiper swiper-initialized swiper-horizontal swiper-pointer-events">
                <div class="swiper-wrapper" style="transform: translate3d(0px, 0px, 0px);">
                    <!-- 图片区域 可设置循环-->
                    <div v-for="(item, index) in schoolDate.image" :key="index"
                        class="f-c-c swiper-slide swiper-slide-active" style="width: 386.667px; margin-right: 20px;">
                        <div class="el-imag" style="width: 314px; height: 197px;">
                            <img :src="'/api' + item" alt=""
                                style="object-fit: cover;vertical-align: top;width: 100%;height: 100%;">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 招聘信息 -->
    </div>
</template>

<script>
import { findSchool, findSchoolArticleList } from '../api/School'
import breadCrumb from '../components/bread-crumb.vue'

export default {
  components: { breadCrumb },
    data() {
        return {
            schoolDate: {},
            // 学校新闻数据
            ArticleList:[],
            params:{
                pageNum:1,
                pageSize:4,
            }
        }
    },
    created() {
        // 获取学校信息
        let schoolId = this.$route.query.schoolId
        findSchool({ schoolId: schoolId }).then(res => {
            this.schoolDate = res.data
            this.schoolDate.label = res.data.label.split(',')
            this.schoolDate.image = res.data.image.split(',')
        }),
        this.params.schoolId = schoolId
        this.params.typeName = '院校新闻'
        findSchoolArticleList(this.params).then(res=>{
            this.ArticleList = res.rows
        })
    },
    updated() {
        this.$toTop()
    }
}
</script>

<style lang="less" scoped>

// 主体部分
.introduction-head {
    margin-top: 14px;

    // 左边布局
    .introduction-head-left {
        width: 660px;
        height: 416px;

        .el-image {
            width: 100%;
            height: 100%;
            position: relative;
            overflow: hidden;
            display: inline-block;
        }
    }

    // 右边布局
    .introduction-head-right {
        width: 507px;
        height: 416px;

        .right-title {
            font-family: NotoSansHans-Bold;
            font-size: 30px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 22px;
            letter-spacing: 0px;
            color: #000;
        }

        .right-label {
            border-bottom: 1px solid #eee;
            padding: 14px 0 9px 0;

            .item-label {
                width: 85px;
                height: 23px;
                background-color: #ffffff;
                border-radius: 6px;
                border: solid 1px #ba0825;
                opacity: 0.3;
                font-family: NotoSansHans-Regular;
                font-size: 12px;
                font-weight: normal;
                font-stretch: normal;
                line-height: 68px;
                letter-spacing: 0px;
                color: #ba0825;
                margin-right: 5px;
            }
        }

        .right-text {
            font-family: NotoSansHans-Regular;
            font-size: 14px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 40px;
            letter-spacing: 0px;
            color: #808080;
        }

        .school-info {
            border-bottom: 1px solid #eaeaea;

            .school-info-label {
                font-family: NotoSansHans-Bold;
                font-size: 14px;
                font-weight: normal;
                font-stretch: normal;
                line-height: 22px;
                letter-spacing: 0px;
                color: #000000;
            }

            .school-info-text {
                margin-left: 19px;
                font-family: NotoSansHans-Regular;
                font-size: 14px;
                font-weight: normal;
                font-stretch: normal;
                line-height: 22px;
                letter-spacing: 0px;
                color: #3d6cba;
            }
        }

        .school-box {
            padding-top: 10px;

            .school-info-label {
                font-family: NotoSansHans-Bold;
                font-size: 14px;
                font-weight: normal;
                font-stretch: normal;
                line-height: 40px;
                letter-spacing: 0px;
                color: #000000;
            }

            .school-info-text {
                margin-left: 19px;
                font-family: NotoSansHans-Regular;
                font-size: 14px;
                font-weight: normal;
                font-stretch: normal;
                line-height: 40px;
                letter-spacing: 0px;
                color: #3d6cba;
            }
        }

        .school-introduce {
            margin-top: 23px;
            width: 507px;
            height: 190px;
            font-family: NotoSansHans-Regular;
            font-size: 14px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 24px;
            letter-spacing: 0px;
            color: #808080;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 8;
            text-overflow: ellipsis;
        }
    }
}

.lable-item {
    width: 310px;

    .lable-item-text {
        font-family: NotoSansHans-Light;
        font-size: 22px;
        font-weight: normal;
        font-stretch: normal;
        line-height: 40px;
        letter-spacing: 0px;
        color: #000000;
        margin-right: 19px;
    }
}

.swiper {
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 0;
    z-index: 1;
}

.swiper-container {
    touch-action: pan-y;

    .swiper-wrapper {
        display: flex;
    }
}</style>